home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / INSERT SPOTLIGHT.SCRIPT < prev    next >
Encoding:
Text File  |  1998-02-13  |  1.5 KB  |  47 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert SpotLight~inserts the SpotLight node. The SpotLight node defines 
  6. a light source that emits light from a specific point along a specific 
  7. direction vector and constrained within a solid angle. 
  8. @EndTool: 
  9. @Summary: insert SpotLight~inserts the SpotLight node
  10. */
  11.  
  12. var Node = 
  13. "SpotLight {" +
  14. "\n\tambientIntensity  0          # exposedField SFFloat" + 
  15. "\n\tattenuation       1 0 0      # exposedField SFVec3f" + 
  16. "\n\tbeamWidth         1.570796   # exposedField SFFloat" + 
  17. "\n\tcolor             1 1 1      # exposedField SFColor" + 
  18. "\n\tcutOffAngle       0.785398   # exposedField SFFloat" + 
  19. "\n\tdirection         0 0 -1     # exposedField SFVec3f" + 
  20. "\n\tintensity         1          # exposedField SFFloat" + 
  21. "\n\tlocation          0 0 0      # exposedField SFVec3f" + 
  22. "\n\ton                TRUE       # exposedField SFBool" +  
  23. "\n\tradius            100        # exposedField SFFloat" + 
  24. "\n}" +
  25. "\n@Caret";
  26.  
  27. function DoCommand()
  28. {
  29.   var textUtilities = getScriptObject("Library\\textUtilities.script");
  30.   if (textUtilities)
  31.   {
  32.     var editor = getActiveEditor();
  33.     if (editor)
  34.     {
  35.       var lineIndex = textUtilities.InsertString(editor, Node);
  36.       
  37.       // Now replace @Caret with the real caret
  38.       var range = editor.findFirst("@Caret", lineIndex, 0);
  39.       editor.replace("", range);
  40.       editor.setActive("Insert SpotLight Node");
  41.     }
  42.   }
  43. }
  44.  
  45. !!/Script
  46.  
  47.